Skip to content

Conversation

@fan-zhang-sv
Copy link
Collaborator

@fan-zhang-sv fan-zhang-sv commented Dec 3, 2024

Summary

We decided to switch over to AuthSession for many benefits including shared cookies w standalone browser, more reliable deeplinking via custom scheme, etc.

This PR:

  • Switches over to use Expo's openAuthSessionAsync
  • Removes appDeeplinkUrl from AppMetadata
  • appCustomScheme is now required in AppMetadata
  • Removes handleResponse as this is now handled by Expo and consumer won't need to handle response URL manually
  • Includes breaking change for consumer, will aim for 1.0.0 for next release

How did you test your changes?

iOS Android
Screen.Recording.2024-12-03.at.3.03.22.PM.mov
Screen.Recording.2024-12-03.at.3.14.05.PM.mov

): Promise<RPCResponseMessage> {
const { type, scheme } = wallet;

if (type === 'webBased') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can this just be web?

const AVAILABLE_CHAINS_STORAGE_KEY = 'availableChains';
const WALLET_CAPABILITIES_STORAGE_KEY = 'walletCapabilities';
import * as Communicator from './components/communicator';
import * as Communicator from './components/communication';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, can we just import postRequestToWallet directly?

@@ -1,2 +1 @@
export * from './handleResponse';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this barrel file. Not great for tree shaking


provider = new EIP1193Provider({
metadata: { appName: 'Test App', appDeeplinkUrl: 'test://deeplink' },
metadata: { appName: 'Test App', appCustomScheme: 'test://deeplink' },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're publishing a new version do we really need the app prefix on these vars?

can we just same name, scheme, etc...? feels a tad verbose

@fan-zhang-sv fan-zhang-sv requested a review from cb-jake December 4, 2024 17:30
Comment on lines +43 to +44
appName: string;
appLogoUrl?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the scw client expect this naming still?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, scw client is expecting app prefix from both web sdk and mobile sdk, so keeping it like this for simplicity

const AVAILABLE_CHAINS_STORAGE_KEY = 'availableChains';
const WALLET_CAPABILITIES_STORAGE_KEY = 'walletCapabilities';
import * as Communicator from './components/communicator';
import * as Communicator from './components/communication/postRequestToWallet';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import * as Communicator from './components/communication/postRequestToWallet';
import { postRequestToWallet } from './components/communication/postRequestToWallet';

@fan-zhang-sv fan-zhang-sv merged commit 92b39a8 into master Dec 4, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants